package chapter3;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description:  比较成本
 * Date:2021/4/2
 * ***************************************************************
 */
public class exc3_33 {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		System.out.println("Enter weight and price for package 1: ");
		double w1=input.nextDouble();
		double p1=input.nextDouble();
		double unit_price1=w1/p1;
		System.out.println("Enter weight and price for package 2: ");
		double w2=input.nextDouble ();
		double p2=input.nextDouble();
		double unit_price2=w2/p2;
		
		if(unit_price1>unit_price2) {
			System.out.println("The package1 has a better price.");
		}else if(unit_price1<unit_price2) {
			System.out.println("The package2 has a better price.");
		}else {
			System.out.println("Two packages have the same price.");
			
		}
		
		
		
	}

}
